﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Irony.Ast;
using Irony.Parsing;

namespace ConciseMarkupLanguage.Ast
{
    class GenericNode : AstNode
    {
        public override void Init(ParsingContext context, ParseTreeNode treeNode)
        {
            base.Init(context, treeNode);
            if (treeNode.ChildNodes.Count > 0)
                AsString += ": " + treeNode.ChildNodes[0].FindTokenAndGetText();
            foreach (var node in treeNode.ChildNodes.Where(n => n != null))
                AddChild(null, node);
        }
    }
}
